package com.xbongbong.saas.model;

import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.competitor.CompetitorUserEntity;
import org.elasticsearch.action.support.WriteRequest;

import java.util.List;
import java.util.Map;

/**
 * @author Dell
 * @version v1.0
 * @date 2022/8/10 18:39
 * @since v1.0
 */
public interface CompetitorUserModel extends IModel<CompetitorUserEntity> {
    CompetitorUserEntity getByKey(Long id,String corpid);

    List<CompetitorUserEntity> findBaseEntities(Map<String,Object> params);

    /**
     *
     * date: 2022/8/18 4:05 下午
     * @author yingjf
     * @param saasFormSaveDTO:
     * @param dataId:
     * @param corpid:
     * @param visbleDept:
     * @param visbleUser:
     */
    void refreshProductUser(SaasFormSaveDTO saasFormSaveDTO, Long dataId, String corpid, List<Object> visbleDept, List<Object> visbleUser) throws XbbException;

    /**
     * 批量插入
     * @param insetBatchList
     */
    void inserBatch(List<CompetitorUserEntity> insetBatchList) throws XbbException;

    /**
     * 批量删除
     *
     * @param corpid    公司id
     * @param delIdList idList
     */
    void deleteBatch(String corpid, List<Long> delIdList) throws XbbException;

    /**
     * 批量删除竞争对手可见人
     * @param corpid
     * @param dataIdList
     * @param competitorUserEntityList
     * @return: void
     * @throws:
     */
    void deleteBatch(String corpid,List<Long> dataIdList,List<CompetitorUserEntity> competitorUserEntityList) throws XbbException;

    /**
     * 删除
     * date: 2022/8/23 5:20 下午
     * @author yingjf
     * @param competitorUserEntity:
     */
    void delete(CompetitorUserEntity competitorUserEntity) throws XbbException;

    /**
     * 批量删除
     * @param corpid
     * @param competitorUserEntityList
     * @param del
     * @param refreshPolicy
     */
    void deleteBatch(String corpid, List<CompetitorUserEntity> competitorUserEntityList, WriteRequest.RefreshPolicy refreshPolicy, Integer del) throws XbbException;

}
